define([
    'jQuery',
    'Underscore',
    'Backbone',
    'Kendo',
    'models/root',
], function($, _, Backbone, Kendo, Root) {

    
    
    var rootDatasource = new kendo.data.DataSource({

        
        
        //type: "json",
        
        
        schema: {
            data: "data",
            model: Root, // use the root model
            total: function(response) {
                return $(response.data).length;
            }
        },
        
        
        
        pageSize: 10,

        
        
        transport: {
            
            read: {
                url: "/vta/root/all.json",
                type: "GET",
                success: function(jeroen, evelijn) {
                    console.log(jeroen);
                    console.log(evelijn);
                }
            },
            
            update: {
                url: "/vta/root/update.json",
                type: "POST"
            },
            
            create: {
                url: "/vta/root/create.json",
                type: "PUT"
            },
                                            
        },
        
        
        
        error: function(e) {
            alert(e.responseText);
        },
        
        
        
        change: function(data) {
//            console.log(data);
        },
        
        
        sort: {
            field: 'id',
            dir: 'asc'
        }
        
        
                
    });
    
    
    
    return rootDatasource;
    
    
    
});